<template>
    <div class="w-full h-full">
      <div class="w-2/3 m-auto">
        <ListCard class="mt-2 h-32" v-for="item in article" :key="item.id" :title="item.reserve_1" :content="item.content" :time="item.created_time"></ListCard>
      </div>
    </div>
</template>
 
<script setup>
import { ref,onMounted } from 'vue'
import axios from 'axios'
import ListCard from "~/components/ListCard.vue";
let article = ref([])
const getArticle = ()=>{
  axios.post('http://localhost:8000/news/get_one',{}).then(res => {
    let data = res.data
    if(data.code===200){
      article.value = data.data
    }
  })
}
onMounted(()=>{
  getArticle()
})
</script> 
 
<style scoped></style>